/*
 * config.h
 *
 *  Created on: 28 Apr 2015
 *      Author: yiqi.pan
 */

#ifndef SRC_CONFIG_H_
#define SRC_CONFIG_H_

#include "common.h"
/* use RB112 bluetooth module */
#define RB112



/* define the DMA parameters related to bluetooth USART */
#define BT_UART                	  USART1
#define BT_USART_DMA_CHANNEL_TX   DMA1_Channel2
#define BT_USART_DMA_FLAG_TCTX    (uint16_t)DMA1_FLAG_TC1

#define BT_USART_DR_ADDRESS       USART1_BASE  /* USART1 Data register Address */
#define BT_UART_GPIO_PORT         GPIOB
#define BT_UART_CLK               CLK_Peripheral_USART1
#define BT_UART_RxPin             GPIO_Pin_7
#define BT_UART_TxPin             GPIO_Pin_6

#ifdef RB112
#define RB112_GPIO_PORT GPIOA
#define BT_RESET_PIN GPIO_Pin_6
#define BT_DISCONNECT_PIN GPIO_Pin_7
#endif

/* LED configuration */
#define LED_GPIO_PORT GPIOB
#define LED_GPIO_PIN1 GPIO_Pin_2
#define LED_GPIO_PINS (LED_GPIO_PIN1)

/* Button configuration */
#define USER_BUTTON_PORT GPIOC
#define USER_BUTTON_PIN GPIO_Pin_1

#define RESET_BUTTON_PORT GPIOA
#define RESET_BUTTON_PIN  GPIO_Pin_1

#endif /* SRC_CONFIG_H_ */
